//
//  CAIBehaviorStandardAttack.h
//  beast_tamer
//
//  Created by  bk on 13/2/24.
//
//

#ifndef beast_tamer_CAIBehaviorStandardAttack_h
#define beast_tamer_CAIBehaviorStandardAttack_h

#include "CAIManager.h"
#include "CBaseAI.h"
#include "AIDef.h"
#include "CProcessFunctions.h"
#include "point.h"

class CBattleObject;
class CAIBehaviorStandardAttack : public CAIBehavior , public CProcessFunctions<CAIBehaviorStandardAttack>
{
public:
    
    enum
    {
        SEARCH =0,
        MOVE = 1,
        ATTACK = 2,
    };
    
    enum
    {
        MOVELEN = 1
    };
    
    enum ATTACK_DISTANCE
    {
        ATTACK_DISTANCE_X = 25 ,
        
        ATTACK_DISTANCE_Y = 10,
    };
    
    enum
    {
        START_ATTACK_TIME = 2,
        START_SEARCH_TIME = 1,
    };
    
    
    CAIBehaviorStandardAttack();
    
    virtual ~CAIBehaviorStandardAttack();
    
    virtual bool Init(CAIManager*);
    
    virtual void Entering(IStateInput*);
    
    virtual void Update(IStateInput*);
    
    virtual void Leaving(IStateInput*);
    
    virtual int ShouldChange(IStateInput*);
    
protected:
    
    void    onProcessSearch();
    void    onProcessMove();
    void    onProcessAttack();
    
    void    onHandleDamage(void* Data);
    fPoint    HandleMoveCoodinate(fPoint);
    
private:
    
    CBattleObject* m_targetObject;
    
    bool           m_isStartTime;
    
    float          m_StartTime;
};

#endif
